<cfquery name="GetImport" datasource="WMS">
	select *
	from import_temp
	where payment_date is not null
</cfquery>

<cfloop query="GetImport">
	<cfquery name="UpdatePayment" datasource="WMS">
		update payment
		set payment_submitted_date = <cfqueryparam value="#payment_submitted_date#" cfsqltype="cf_sql_date">,
		payment_date = <cfqueryparam value="#payment_date#" cfsqltype="cf_sql_date">,
		payment_type = <cfqueryparam value="#payment_type#" cfsqltype="cf_sql_varchar">,
		payment_amount = <cfqueryparam value="#payment_amount#" cfsqltype="CF_SQL_FLOAT">,
		payment_reference = <cfqueryparam value="#payment_reference#" cfsqltype="cf_sql_varchar">,
		notes = <cfqueryparam value="#notes#" cfsqltype="cf_sql_varchar">
		where payment_id = <cfqueryparam value="#payment_id#" cfsqltype="cf_sql_integer">
	</cfquery>
</cfloop>

<cfoutput>
Done.  Imported #GetImport.RecordCount# records.
</cfoutput>